package com.ruoyi.Processor;

import com.ruoyi.common.entity.Project;
import org.jsoup.nodes.Element;

// 图片处理器
class ImageProcessor implements ContentProcessor {
    @Override
    public boolean canProcess(Element element) {
        return element.tagName().equals("img");
    }
    
    @Override
    public void process(Element element, Project project) {
        String src = element.attr("src");
        if (project.getResourceUrl() == null) {
            project.setImg(src);
        }
    }
}
